package file;
import java.io.File;
import java.io.FileFilter;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        File file = new File("D:/note/");
        if (file.exists()) {
            System.out.println("该文件已存在");
        } else{
            file.createNewFile();
            System.out.println("该文件已创建");
        }
        FileOutputStream fos = new FileOutputStream(file);
        fos.write(1);
        fos.close();
    }
    }